Skip to content

Jakub Al Khaled - task resolution#4

Open
jacobkaled wants to merge 1 commit intomeiroio:masterfrom
jacobkaled:FE-resolution
Open

Jakub Al Khaled - task resolution#4
jacobkaled wants to merge 1 commit intomeiroio:masterfrom
jacobkaled:FE-resolution

Conversation

@jacobkaled
Copy link

@jacobkaled jacobkaled commented Feb 11, 2024

Dear Meiro.io team, appologies for trying to push directly to your repo ( i managed to do the fork but i lost the history ), anyway, lets get straight into the solution :

technologies used: react , mui , react-router ,react-query, recoil, use-query-params
I tried to solve the data persistence through routes in there different ways:

1- using query params as global state (/attributes1) :
Pros:
-the url is reachable
cons :
-additional depndency (use-query-params)
-need to to validate the url params on the top of the route

2- passing data between routes using react-router navigate (/attributes2) :
Pros:
-No need for additional dependency (use react-router only )
Cons :
-Might be unreliable

3- using global state manager (/attributes3) :
-pros: works as expected
-Cons:
additional dependency (recoil)
Need to reset the global state inside each route (except the sub-route /attribute )

Additions :
- implemented toast message for showing success / error messages

Todos :
- handle errors
- store users scroll position for better ux
- better UI design

Pitfalls :
- infiniteQuery spits some typing errors
- mapping ids to labels might be slow ( I would rather do the mapping on backend so frontend as it can be faster )

@jacobkaled jacobkaled changed the title task resolution Jakub Al Khaled - task resolution Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant